angular.module('app')

.factory('IndexService', ['$http','$cacheFactory', function($http,$cacheFactory) {
	//var indexesCache = $cacheFactory("indexes");
	return {
		getIndexNum: function(type) { 
			console.log("GET getIndexNum.es");
			return $http({
				method: 'GET',
				url: 'getIndexNum.es',
			})
		},
		findAllIndexes: function(currentPage, itemsPerPage) { 
			//var results = indexesCache.get("indexes");
			//if (results) {
			//	return results;
			//}
			console.log("GET findAllIndexes.es?currentPage="+currentPage + "itemsPerPage="+itemsPerPage);
			return $http({
				method: 'GET',
				url: 'findAllIndexes.es',
				params: {currentPage: currentPage, itemsPerPage: itemsPerPage},
				//cache: indexesCache
			})
		},
	};
}])